package details.service.impl;

import details.entity.Wxuserdetails;
import details.mapper.WxuserdetailsMapper;
import details.service.Userdetailsservice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class Userdetailsserviceimpl implements Userdetailsservice {
    @Autowired
    WxuserdetailsMapper wxuserdetailsMapper;

    @Override
    public Wxuserdetails selectByPrimaryKey(Integer id) {
        return wxuserdetailsMapper.selectByPrimaryKey(id);
    }

    @Override
    public Integer insertSelective(Wxuserdetails wxuserdetails) {
        wxuserdetails.setUserbasicsbottlecount(5);
        wxuserdetails.setUserfishingcount(3);
        wxuserdetails.setUserpalbottlecount(3);
        System.out.println(wxuserdetails.getUserfishingcount());
        return wxuserdetailsMapper.insertSelective(wxuserdetails);
    }

    @Override
    public Integer updateByPrimaryKeySelective(Wxuserdetails wxuserdetails) {

        return wxuserdetailsMapper.updateByPrimaryKeySelective(wxuserdetails);
    }

    @Override
    public Integer deleteByPrimaryKey(Integer id) {
        return wxuserdetailsMapper.deleteByPrimaryKey(id);
    }

    @Override
    public Wxuserdetails selectOpenid(String openid) {

        return wxuserdetailsMapper.selectOpenid(openid);
    }

    @Override
    public Integer updatecount() {
        return wxuserdetailsMapper.updatecount();
    }
}
